#-------------------------------------------------------------------------------
# Name:        module1
# Purpose:
#
# Author:      bc6
#
# Created:     18/07/2012
# Copyright:   (c) bc6 2012
# Licence:     <your licence>
#-------------------------------------------------------------------------------
#!/usr/bin/env python

def main():
    pass

if __name__ == '__main__':
    main()


ranks = ss.rankdata(dists)
rank_ids = [[rank, ranks.tolist().index(rank)] for rank in ranks]
sorted_rank_ids = sorted(rank_ids)
# indices are sorted by their ranks, return the filenames
ret = [imgs_names[idx[1]] for idx in sorted_rank_ids]